package com.cskaoyan.bean.promotion.coupon;

import com.github.pagehelper.PageInfo;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

/**
 * @Description:
 * @Author: WD created on 2021-09-16 17:05
 * @Version:
 */
@NoArgsConstructor
@Data
public class ShowCouponListVO {


    private Integer total;
    private Integer pages;
    private Integer limit;
    private Integer page;
    private List<CouponListVO> list;


    public ShowCouponListVO(PageInfo<Coupon> pageInfo, ArrayList<CouponListVO> couponListVOs) {
        this.total = Math.toIntExact(pageInfo.getTotal());
        this.limit = pageInfo.getPageSize();
        this.page = pageInfo.getPageNum();
        this.pages = pageInfo.getPages();
        this.list = couponListVOs;

    }
}
